<?php
declare (strict_types=1);

namespace app\model;

use think\Model;
use think\model\relation\HasOne;

/**
 * @mixin Model
 */
class SystemSetting extends Model
{
    // 定义时间戳字段名
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';

    /**
     * 违规图占位图片
     * @return HasOne
     */
    public function imageForbidden(): HasOne
    {
        return $this->hasOne(SystemUploadfile::class, 'id', 'image_forbidden_id');
    }

    /**
     * 站点介绍语音
     * @return HasOne
     */
    public function introVoice()
    {
        return $this->hasOne(SystemUploadfile::class, 'id', 'intro_voice_id');
    }
}
